home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17657 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  39 lines

  1. Path: ip-pdx14-05.teleport.com!user
  2. From: weld@teleport.com (J.R. Tipton)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: one character input?
  5. Date: Wed, 17 Apr 1996 17:04:22 -0700
  6. Organization: ARC
  7. Message-ID: <weld-1704961704220001@ip-pdx14-05.teleport.com>
  8. References: <3173AAF0.3515@struct.kth.se>
  9. NNTP-Posting-Host: ip-pdx14-05.teleport.com
  10.  
  11. In article <3173AAF0.3515@struct.kth.se>, Peter Andren
  12. <andren@struct.kth.se> wrote:
  13.  
  14. > Hello,
  15. > I need a function to read one character from the keyboard without to end
  16. > the input with a returncharacter. Unfortunatly I'm not able to find this
  17. > funtion in my book, but I have a strong feeling that it shouldn't be so
  18. > difficult.
  19.  
  20. In most compilers, the macro getch() works.  Example:
  21.  
  22. void main()
  23. {
  24.  char choice;
  25.  
  26.  printf("Type something. ");
  27.  choice=getch();
  28.  ...
  29. };
  30.  
  31. getch() is actually a macro I believe, but don't worry about that yet :)
  32.  
  33. J. R.    T I P T O N                            weld@teleport.com
  34. *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  35. * "I wish to paint as if no painter has painted before me."     *
  36. *  WWW Page = http://www.teleport.com/~weld                     *
  37. *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  38.